package com.lily.test;

import org.junit.Test;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

/**
 * @author lily
 */
public class testRedisByPool {


    @Test
    public void testString(){
        JedisPoolConfig config = new JedisPoolConfig();
        config.setMaxIdle(10);
        config.setMaxTotal(10);

        JedisPool jedisPool = new JedisPool("localhost",6379);
//        JedisPool jedisPool = new JedisPool();
        Jedis jedis = jedisPool.getResource();

        jedis.set("name","lily");
        String name = jedis.get("name");
        System.out.println(name);
        jedis.close();
    }



}
